#!/usr/bin/env python

"""\
INSTRUCTIONS:

(1) Plot ellipse with the main axes a=2, b=1.  Make sure the ellipse is
    drawn at correct aspect ratio.

(2) Export the figure in EPS format to an ex02ellipse.eps file.

HINT: Check documentation for matplotlib functions "axis" and "savefig".
"""

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
# clear the current figure
#plt.clf()

phi = np.linspace(0, 2 * np.pi, 400)
# +++your code here+++

theta = np.arange(0.0, 360.0, 1.0)*np.pi/180.0
x = 0.5 * 1 * np.cos(theta)
y = 0.5 * 2 * np.sin(theta)



fig=plt.figure()
ax=fig.add_subplot(111, aspect=1)
ax.plot(x,y)
ax.set_xlim(-10,10)
ax.set_ylim(-10,10)

# redraw and display the figure window
plt.draw()

plt.savefig('ex02ellipse.eps', dpi=100)
plt.show()
